home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ShareWare OnLine 2
/
ShareWare OnLine Volume 2 (CMS Software)(1993).iso
/
games2
/
rotise12.zip
/
RDB.H
< prev
next >
Wrap
C/C++ Source or Header
|
1992-04-03
|
4KB
|
114 lines
#ifndef H_RDB /* Allow multiple inclusions */
#define H_RDB
#include "bb_pdb.h"
/* some flags and such */
/* which kind of league */
#define AL 0
#define NL 1
#define XL 2 /* Both/Neither league */
/* player data line argument list */
#define ARG_SLOT 0 /* slot name */
#define ARG_NK1 (ARG_SLOT+1) /* Name key 1 */
#define ARG_NK2 (ARG_NK1+1) /* Name key 2 */
#define ARG_TEAM (ARG_NK2+1) /* Team abbrev */
#define ARG_SAL (ARG_TEAM+1) /* salary */
#define ARG_CONT (ARG_SAL+1) /* contract */
#define ARG_WF (ARG_CONT+1) /* first week */
#define ARG_WL (ARG_WF+1) /* last week */
#define ARG_NAMES (ARG_WL+1) /* name string */
/* contract status */
#define CONT_1 0x0001 /* First year */
#define CONT_2 0x0002 /* Second year */
#define CONT_OPT 0x0004 /* Option year */
#define CONT_YR 0x0008 /* Long term contract */
#define CONT_YRM 0xff00 /* # years left mask */
#define CONT_YRSH 8 /* right shift to get @ years */
/* Indexes into the rankings array */
#define RANK_AVG 0
#define RANK_HR (RANK_AVG +1)
#define RANK_RBI (RANK_HR +1)
#define RANK_SB (RANK_RBI +1)
#define RANK_WINS (RANK_SB +1)
#define RANK_SVS (RANK_WINS +1)
#define RANK_ERA (RANK_SVS +1)
#define RANK_RATIO (RANK_ERA +1)
#define RANKSIZE (RANK_RATIO +1)
/* The arguments to build player */
#define ARG_ADD_CMD 0
#define ARG_ADD_RT 1 /* Roto team key */
#define ARG_ADD_PK1 2 /* Player key1 */
#define ARG_ADD_PK2 3 /* Player key, part 2 */
#define ARG_ADD_SLOT 4 /* Already defined slot - 2 letters */
#define ARG_ADD_SAL 5 /* Salary, in salary units */
#define ARG_ADD_CONT 6 /* Contract - one letter */
#define ARG_ADD_NAME 7 /* Start of name */
/* Values for status */
#define STATUS_ACTIVE 0 /* On active roster */
#define STATUS_RESERVE 1 /* On reserve list */
#define STATUS_OLD 2 /* Old player's stats */
#define STATUS_MINORS 3 /* On minor league reserves */
/* max chars in the various names */
#define MAX_LEAGUESIZE 40 /* League name */
#define MAX_TEAMSIZE 40 /* Rotisserie team owner name */
#define MAX_NAMESIZE 40 /* Full Player name */
#define MAX_OWNERSIZE 40 /* Owner's name */
#define MAX_SLOT 3 /* Max Size of slot string */
/* settings for the weird field: zorch */
#define PLAYER_UNAVAILABLE -1 /* Not really available */
#define PLAYER_FREE 0 /* Free agent */
#define PLAYER_CLAIMED 1 /* On a rotise team */
#define PLAYER_HIDDEN 2 /* Hidden off free agent list */
#define WAIVED_STRING "WAIV" /* Status string for waived players */
typedef struct _rdb_slot { /* Info about a slot */
char slot[MAX_SLOT +1]; /* Slot name */
UWORD pos; /* Positional information */
} RDB_SLOT;
typedef struct _rdb_player { /* Player data */
char name[MAX_NAMESIZE+1]; /* Player's name */
PDB_PNAME pname; /* players key name */
char slot; /* Slot # as defined in slot list */
int salary; /* salary units in salary */
UWORD contract; /* Contract status */
int start; /* first week on team */
int end; /* last week */
int status; /* Status of player vis-a-vis this team */
struct _rdb_player *next; /* pointer to next player in list */
} RDB_PLAYER;
typedef struct _rdb_team {
char key[5]; /* 4 letter max key word */
char name[MAX_TEAMSIZE]; /* Team name */
char owner[MAX_OWNERSIZE]; /* Owner(s) name */
RDB_PLAYER *players; /* players on team */
PDBT_BATTER batters; /* tally batter's stats */
PDBT_BATTER bweek; /* weekly batter's stats */
PDBT_BATTER oldb; /* old batter's stats */
PDBT_PITCHER pitchers; /* tally pitcher stats */
PDBT_PITCHER pweek; /* weekly pitcher stats */
PDBT_PITCHER oldp; /* old pitcher's stats */
float points[RANKSIZE]; /* save rotise points */
float totalPnts; /* final tally of points */
int money_spent; /* amount spent, in salunits */
struct _rdb_team *next; /* Pointer to next rotisserie team */
} RDB_TEAM;
#endif